package com.zc58s.springbootmqtt.mqtt.distributor;

import com.zc58s.springbootmqtt.mqtt.vo.SubcribeRes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.ExecutorService;

/**
 * MQTT 消息分发器
 *
 * @author : fujc-dev@qq.com
 * @created : 2022/9/22 10:07
 */

@Component
public class Distributor {


    @Autowired
    ExecutorService executorService;

    private Distributor() {

    }

    /**
     * 提交消息到分发器
     *
     * @param res 消息内容对象
     */
    public void submit(SubcribeRes res) {
        executorService.submit(new Exector(res));
    }

}
